package com.tgu.controller;

import com.tgu.entity.request.ApproveReq;
import com.tgu.service.IApproveService;
import com.tgu.utils.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("portal/approve")
public class ApproveController {

    @Autowired
    private IApproveService approveService;

    @PostMapping("/accept")
    public Result accept(@RequestBody ApproveReq approveReq) {
        return approveService.accept(approveReq);
    }

    @PostMapping("/refuse")
    public Result refuse(@RequestBody ApproveReq approveReq) {
        return approveService.refuse(approveReq);
    }

    @PostMapping("/callBack")
    public Result callBack(@RequestBody ApproveReq approveReq) {
        return approveService.callBack(approveReq);
    }

    @GetMapping("/getPage/{pageNumb}/{option1}/{option2}")
    public Result getPage(@PathVariable Integer pageNumb, @PathVariable Integer option1, @PathVariable String option2) {
        return approveService.getPage(pageNumb, option1, option2);
    }
}
